package com.example.test.stream31;

import org.apache.kafka.streams.state.RocksDBConfigSetter;
import org.rocksdb.BlockBasedTableConfig;
import org.rocksdb.Options;

import java.util.Map;

public class CustomRocksDBConfigSetter implements RocksDBConfigSetter {
    @Override
    public void setConfig(String storeName, Options options, Map<String, Object> configs) {
        BlockBasedTableConfig tableConfig = (BlockBasedTableConfig) options.tableFormatConfig();
        tableConfig.setBlockCacheSize(50 * 1024 * 1024L);  // 50 MB
        tableConfig.setBlockSize(4 * 1024L);  // 4 KB
    }

    @Override
    public void close(String storeName, Options options) {
        // No-op
    }
}